package _02_第二季._01_排序;

public class Bubble01<E extends Comparable<E>> extends Sort<E>{
    @Override
    protected void sort() {
        for(int end = array.length-1;end>0;--end){
            int sortIndex = 1;
            for(int begin = 1;begin<=end;++begin){
                if(cmp(begin,begin-1)<0){
                    swap(begin,begin-1);

                    sortIndex = begin;
                }
            }
            end = sortIndex;
        }
    }
}
